import QtQuick 2.12
import QtQuick.Controls 2.12
import QtGraphicalEffects 1.14
Slider {
  id: control
  value: 0.5

  background: Rectangle {
      x: control.leftPadding
      y: control.topPadding + control.availableHeight / 2 - height / 2
      implicitWidth: 200
      implicitHeight: 7
      width: control.availableWidth
      height: implicitHeight
      radius: height / 2
      color: "#1F1E1E"      // 设置滑动条颜色
      border.color: "#161616"
      Rectangle {
          width: control.visualPosition * parent.width
          height: parent.height
          color: "#3E3C3E"
          border.color: "#161616"
          radius: parent.height / 2
      }
  }

  handle: Rectangle {   // 设置滑块
      x: control.leftPadding + control.visualPosition * (control.availableWidth - width)
      y: control.topPadding + control.availableHeight / 2 - height / 2
      implicitWidth: 13
      implicitHeight: 13
      radius: 6
      color: control.hovered ? "#E2E2E2" : "#787878"

      border.color: "#4E4E4E"
  }
}
